package de.reichelt.fxrequi.data;

import java.util.Date;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

public class User {
  private final StringProperty name = new SimpleStringProperty();
  private final StringProperty login = new SimpleStringProperty();
  private final StringProperty fullname = new SimpleStringProperty();
  private final BooleanProperty active = new SimpleBooleanProperty();
  private final ObjectProperty<Date> dateCreated = new SimpleObjectProperty<>();
  private final StringProperty userCreated = new SimpleStringProperty();

  public User() {
  }

  public User(String name, String login, String fullname, Boolean isActive, 
          Date dateCreated, String userCreated) {
    setName(name);
    setLogin(login);
    setFullname(fullname);
    setActive(isActive);
    setDateCreated(dateCreated);
    setUserCreated(userCreated);
  }
  
  public String getName() {
    return name.get();
  }

  public void setName(String value) {
    name.set(value);
  }

  public StringProperty nameProperty() {
    return name;
  }
  
  public String getLogin() {
    return login.get();
  }

  public void setLogin(String value) {
    login.set(value);
  }

  public StringProperty loginProperty() {
    return login;
  }
  
  public String getFullname() {
    return fullname.get();
  }

  public void setFullname(String value) {
    fullname.set(value);
  }

  public StringProperty fullnameProperty() {
    return fullname;
  }
  
  public boolean isActive() {
    return active.get();
  }

  public void setActive(boolean value) {
    active.set(value);
  }

  public BooleanProperty activeProperty() {
    return active;
  }
  
  public Date getDateCreated() {
    return dateCreated.get();
  }

  public void setDateCreated(Date value) {
    dateCreated.set(value);
  }

  public ObjectProperty dateCreatedProperty() {
    return dateCreated;
  }
  
  public String getUserCreated() {
    return userCreated.get();
  }

  public void setUserCreated(String value) {
    userCreated.set(value);
  }

  public StringProperty userCreatedProperty() {
    return userCreated;
  }

  @Override
  public String toString() {
    return fullname.get();
  }
  
  

}
